﻿using System.Collections.Generic;
using System.Linq;
using System.Text;
using WinnerCMS.BLL;
using WinnerCMS.BLL.PageFactory.TagModule;
using WinnerCMS.Common;
using WinnerCMS.Model;

namespace WinnerCMS.WebFactory
{
    public class PhotoCommon
    {

        static public string PhotoList(string templateString, ICollection<PhotoList> list)
        {
            StringBuilder tempStrBuilder = new StringBuilder();
            string strMode = TagEngine.GetString(templateString, "PhotoList", GetWhich.ItemTemplate);
            if (list.Any())
            {
                foreach (var model in list)
                {
                    tempStrBuilder.Append(strMode);

                    PageCommon.RepalceFiled(tempStrBuilder, model);
                }
            }
            else
            {
                return string.Empty;
            }

            return tempStrBuilder.ToString();
        }
    }
}
